<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<link rel='stylesheet' type='text/css' href='${initParam.root }/css/popup.css' />

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>

<script type="text/javascript">

	$(document).ready(function(){
		if("${sessionScope.mvo!=null}"){
			$.ajax({
				url:"${initParam.root}/mentoring/getNewNote.do",
				data:"id=${sessionScope.mvo.id}",
				dataType:"json",
				success:function(data){
					var str="";
					if(data.newQuestion!=0){
						str+="<a href='${initParam.root }/mentoring/status.do?page=1'>새질문 ";
						str+=data.newQuestion+"</a>&nbsp;";
					}
					if(data.newNote!=0){
						str+="<a href='${initParam.root }/mentoring/myMentoring.do'>새쪽지 ";
						str+=data.newNote+"</a>";
					}
					$("#noteInfo").html(str);
				}
			});
		
		}
			
				
		$("#join").click(function(){
			location.href="${initParam.root }/joinview.do";
		});//join click
		
		$("#logout").click(function()
		{
			location.href="${initParam.root }/member/logout.do";
		});//logout click
		
	$('a.login-window').click(function (){
		 //Getting the variable's value from a link 
	   var loginBox = $("a.login-window").attr('href');

	    //Fade in the Popup
	    $(loginBox).fadeIn(300);
	    
	    //Set the center alignment padding + border see css style
	    var popMargTop = ($(loginBox).height() + 24) / 2; 
	    var popMargLeft = ($(loginBox).width() + 24) / 2; 
	    
	    $(loginBox).css({ 
	        'margin-top' : -popMargTop,
	        'margin-left' : -popMargLeft
	    });
	    
	    // Add the mask to body
	   /*  $('body').append('../member/test.jsp');
	    $('#mask').fadeIn(300); */
	    
	    return false;
	    
	});

// When clicking on the button close or the mask layer the popup closed
$('a.close, #mask').live('click', function() { 
  $('#mask , .login-popup').fadeOut(300 , function() {
    $('#mask').remove();  
}); 
  $('#mask , .idsuch-popup').fadeOut(300 , function() {
	    $('#mask').remove();  
	}); 
  $('#mask , .passwordsuch-popup').fadeOut(300 , function() {
	    $('#mask').remove();  
	}); 
  $('#mask , .suchresult-popup').fadeOut(300 , function() {
	    $('#mask').remove();  
	});
  

  
return false;
});
		
		
	
$("#forgotid").click(function(){
	$('#mask , .login-popup').fadeOut(300 , function() {
	    $('#mask').remove();  

		    
            //Getting the variable's value from a link 
    var loginBox = $("#idsuch-box");

    //Fade in the Popup
    $(loginBox).fadeIn(300);
    
    //Set the center alignment padding + border see css style
    var popMargTop = ($(loginBox).height() + 24) / 2; 
    var popMargLeft = ($(loginBox).width() + 24) / 2; 
    
    $(loginBox).css({ 
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });
    
    // Add the mask to body
   /*  $('body').append('../member/test.jsp');
    $('#mask').fadeIn(300); */
    
    return false;
});
	}); 
$("#forgotpassword").click(function(){
	$('#mask , .login-popup').fadeOut(300 , function() {
	    $('#mask').remove();  

		    
            //Getting the variable's value from a link 
    var loginBox = $("#passwordsuch-box");

    //Fade in the Popup
    $(loginBox).fadeIn(300);
    
    //Set the center alignment padding + border see css style
    var popMargTop = ($(loginBox).height() + 24) / 2; 
    var popMargLeft = ($(loginBox).width() + 24) / 2; 
    
    $(loginBox).css({ 
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });
    
    // Add the mask to body
   /*  $('body').append('../member/test.jsp');
    $('#mask').fadeIn(300); */
    
    return false;
});
	}); 
	

    
});


	
		
	</script>

</head>
<body>

<div id="header">
<div id="logo">
<a href="${initParam.root }/main.do" title="Homepage &raquo;">ELCS</a></div>
<div id="mypage">
<c:choose>
	<c:when test="${sessionScope.mvo == null}">
		<a href="#login-box" class="login-window">Login </a>&nbsp;&nbsp;
		<a id="join">Join</a> &nbsp;&nbsp;
		
	</c:when>
	<c:otherwise>
		${sessionScope.mvo.name }님&nbsp; &nbsp;
		<a id="logout">Logout</a>&nbsp; &nbsp;
		<a href="${initParam.root }/member/mypage.do">Mypage</a><br>
	</c:otherwise>
</c:choose>


</div>
<div id="slogan">English Learning Community System</div>
<div id="noteInfo"></div>
</div>
<div id="cssmenu">
	<ul>
		<li><a href="${initParam.root }/aboutUs.do">ABOUT US</a></li>
		
		<li class="mentoring"><a href="${initParam.root }/mentoring/mentoring.do">MENTORING</a>
			<ul >
				<li><a href="${initParam.root }/mentoring/question.do">Question</a></li>
				<li><a href="${initParam.root }/mentoring/status.do?page=1">Status</a></li>
				<li><a href="${initParam.root }/mentoring/myMentoring.do">My Mentoring</a></li>
			</ul>
		</li>
		
		<li class="learning"><a href="">LEARNING</a>
			<ul >
				<li><a href="${initParam.root }/view.do?head=video&type=reply&category=learning">동영상강의</a></li>
				<li><a href="${initParam.root }/view.do?head=study&type=reply&category=learning">학습자료</a></li>
				<li><a href="${initParam.root }/view.do?head=today&type=basic&category=learning">오늘의한마디</a></li>
			</ul>
		</li>
		
		<li  class="community"><a href="">COMMUNITY</a>
			<ul>
				<li><a href="${initParam.root }/view.do?head=testInfo&type=reply&category=community">시험정보</a></li>
				<li><a href="${initParam.root }/view.do?head=academyBookInfo&type=reply&category=community">학원&책정보</a></li>
				<li><a href="${initParam.root }/view.do?head=myKnowHow&type=reply&category=community">나만의 노하우</a></li>
				<li><a href="${initParam.root }/view.do?head=qna&type=reply&category=community">QnA</a></li>
				<li><a href="${initParam.root }/view.do?head=freeBoard&type=reply&category=community">자유 게시판</a></li>
				
			<li><a href="${initParam.root }/rank.do">검색어랭킹</a></li>
			</ul>
		</li>
		
		<li class="help"><a href="">HELP</a>
			<ul >
				<li><a href="${initParam.root }/view.do?head=notice&type=basic&category=help">공지사항</a></li>
				<li><a href="${initParam.root }/view.do?head=faq&type=basic&category=help">FAQ</a></li>
				<li><a href="${initParam.root }/view.do?head=complain&type=answer&category=help">고객의소리</a></li>
				
			</ul>
		</li>
	</ul>


</div>

<div id="login-box" class="login-popup">
<jsp:include page="../member/member_login.jsp"></jsp:include>
</div>
<div id="idsuch-box" class="idsuch-popup">
<jsp:include page="../member/member_suchid.jsp"></jsp:include>
</div>
<div id="passwordsuch-box" class="passwordsuch-popup">
<jsp:include page="../member/member_suchpassword.jsp"></jsp:include>
</div>





